<template>
    <div class="MenuList">
         <el-table
    :data="tableData"
    style="width: 100%">
    <el-table-column
      prop="name"
      label="姓名"
      width="180">
      <template slot-scope="scope">
        <div>
            {{ scope.row.name }}
        </div>
      </template>
    </el-table-column>
    <el-table-column
      prop="address"
      label="地址">
      <template slot-scope="scope">
        <div>
            {{ scope.row.address}}
        </div>
      </template>
    </el-table-column>
       <el-table-column label="操作">
      <template slot-scope="scope">
        <el-button size="mini"  type="primary"  v-menus="'edit'"  @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
        <el-button size="mini" type="danger"  v-menus="'del'" @click="handleDelete(scope.$index, scope.row)">删除</el-button>
        <el-button size="mini" type="danger"   v-menus="'creat'" >分配</el-button>
      </template>
    </el-table-column>
  </el-table>
    </div>
</template>
<script>
export default {
  data() {
    return {
      tableData: [
        {
          name: "边伯贤",
          address: "上海市普陀区金沙江路 1518 弄"
        },
        {
          name: "吴世勋",
          address: "上海市普陀区金沙江路 1518 弄"
        },
        {
          name: "鹿晗",
          address: "上海市普陀区金沙江路 1518 弄"
        },
        {
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄"
        }
      ]
    };
  },
  created(){
    let arr=["creat","edit"]
    localStorage.setItem("permission",JSON.stringify(arr))
  },
  methods: {
     handleEdit(index, row) {
        console.log(index, row);
      },
      handleDelete(index, row) {
        console.log(index, row);
      }
  }
};
</script>

<style lang="scss" scoped>
.el-table .warning-row {
  background: oldlace;
}

.el-table .success-row {
  background: #f0f9eb;
}
</style>
